<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
</body>
<script>
  const data =new Promise((resolve,reject)=>{
    try{
      console.log(`开始请求A数据`);
      setTimeout(()=>{
        let name ={name:`xiaoA`}
        resolve(name)
      },2000)
    }catch(e){
      reject(e.message)
    }
  })
  .then((value)=>{

    return new Promise((resolve,reject)=>{
      try{
      console.log(`开始请求B数据`);
      setTimeout(()=>{
        let  age ={age:18}
        // resolve({...age,...value})
        resolve(Object.assign({},age,value))
        console.log(age);
        console.log(value);
      },2000)
    }catch(e){
      reject(e.message)
    }
    })

  })
  .then((value)=>{

    return new Promise((resolve,reject)=>{
      try{
      console.log(`开始请求C数据`);
      setTimeout(()=>{
        const sex ={sex:`男`}
        // resolve({...sex,...value})
        resolve(Object.assign({},sex,value))
      },2000)
    }catch(e){
      reject(e.message)
    }
    })

  })
  console.log(data);
</script>
</html>